Skip to content

Conversation

@Ioannis
Copy link
Contributor

@Ioannis Ioannis commented Aug 27, 2026

No description provided.

@Ioannis Ioannis requested a review from benno August 27, 2026 09:33
* @return string|null URL
*/

protected function _getUrl(?string $url = null): ?string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this call is on the entity rather than the table to facilitate the lookup in SqlProvisioner? Does the find() on $SrcTable in syncReferenceData() correctly populate url even though it's a virtual field? (If not, we'll need to add the callback back in, and then this call could move to the Table to simplify the lookup in TAndCAgreement.php.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this call is on the entity rather than the table to facilitate the lookup in SqlProvisioner?

Yes, placing _getUrl() on the TermsAndConditions entity encapsulates the fallback logic directly on the data object, allowing $tc->url to resolve automatically across the entire codebase, including SqlProvisioner, TAndCAgreement, REST APIs, and templates, without requiring callers to instantiate or query a table helper.

Does the find() on $SrcTable in syncReferenceData() correctly populate url even though it's a virtual field? (If not, we'll need to add the callback back in, and then this call could move to the Table to simplify the lookup in TAndCAgreement.php.)

Yes, because url is a physical database column, CakePHP tracks it in the entity's visible fields upon hydration from $SrcTable->find(), and $r->toArray() automatically invokes _getUrl(?string $url) during serialization to populate the resolved Mostly Static Page URL into the target record without needing the processTAndC callback.

@Ioannis Ioannis requested a review from benno September 2, 2026 07:36
@Ioannis Ioannis force-pushed the CO-3003_Include_Terms_and_Conditions_and_backing_static_pages_in_People_provisioning_data branch from b5c2ac2 to 8ca7711 Compare September 2, 2026 08:04
@benno benno merged commit ba3dfc9 into COmanage:develop Sep 2, 2026
@Ioannis Ioannis deleted the CO-3003_Include_Terms_and_Conditions_and_backing_static_pages_in_People_provisioning_data branch September 3, 2026 07:05
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants